/**
 * 项目相关类型定义
 */

export interface Project {
  id: string;
  name: string;
  description: string;
  userId: string;
  settings: ProjectSettings;
  createdAt: Date;
  updatedAt: Date;
  articleCount?: number;
  wordCount?: number;
  color?: string; // 项目主题色
  order?: number; // 排序顺序
}

export interface ProjectSettings {
  defaultTemplate?: string;
  aiModel?: string;
  language?: 'zh' | 'en';
  tone?: 'professional' | 'casual' | 'creative';
  autoSave?: boolean;
}

export interface CreateProjectDto {
  name: string;
  description?: string;
  settings?: Partial<ProjectSettings>;
  color?: string;
}

export interface UpdateProjectDto {
  name?: string;
  description?: string;
  settings?: Partial<ProjectSettings>;
  color?: string;
  order?: number;
}

export interface ProjectListParams {
  page?: number;
  pageSize?: number;
  sortBy?: 'createdAt' | 'updatedAt' | 'name' | 'order';
  sortOrder?: 'asc' | 'desc';
  search?: string;
}

export interface ProjectListResponse {
  projects: Project[];
  total: number;
  page: number;
  pageSize: number;
}

export interface Article {
  id: string;
  title: string;
  content: string;
  projectId: string;
  templateId?: string;
  status: 'draft' | 'published' | 'archived';
  metadata: ArticleMetadata;
  createdAt: Date;
  updatedAt: Date;
  publishedAt?: Date;
}

export interface ArticleMetadata {
  tags?: string[];
  category?: string;
  wordCount?: number;
  readingTime?: number;
}

// 预设项目模板
export interface ProjectTemplate {
  id: string;
  name: string;
  description: string;
  icon: string;
  color: string;
  settings: ProjectSettings;
}

// 项目统计信息
export interface ProjectStatistics {
  totalArticles: number;
  totalWords: number;
  publishedArticles: number;
  draftArticles: number;
  lastActivityAt?: Date;
}
